<script lang="ts" setup>
import { useRouter } from 'vue-router'

const router = useRouter()
</script>

<template>
  <div class="waterfall-container">
    <img src="@/assets/image/01.png" alt="" />
    <img src="@/assets/image/02.png" alt="" />
    <img src="@/assets/image/03.png" alt="" />
    <img src="@/assets/image/04.png" alt="" />
    <img src="@/assets/image/05.png" alt="" />
    <img src="@/assets/image/06.png" alt="" />
    <img src="@/assets/image/07.png" alt="" />
    <img src="@/assets/image/08.png" alt="" />
    <img src="@/assets/image/09.png" alt="" />
    <div class="shade">
      <p>精品课程</p>
      <p>这些课程评分高，值得学习</p>
      <a-button type="primary" @click="router.push('/recommend')"
        >查看更多</a-button
      >
    </div>
  </div>
</template>

<style lang="scss" scoped>
.waterfall-container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: .9375rem;

  img {
    display: block;
    width: 100%;
    margin-bottom: .9375rem;
  }

  .shade {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    padding: 1.25rem;
    background: linear-gradient(to top, rgb(255 255 255 / 100%) 20%, rgb(255 255 255 / 0%) 100%);
  }

}
</style>
